package com.scujcc.diandiantv;

import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

public class NetworkFactory {
    public static final String SERVER_URL = "http://120.77.243.78:8080";
    private static Retrofit retrofit;
    private static ChannelApi channelApi;

    static {
        retrofit = new Retrofit.Builder()
                .baseUrl(SERVER_URL)
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    public static ChannelApi getChannelApi() {
        if (null == channelApi) {
            channelApi = retrofit.create(ChannelApi.class);
        }
        return channelApi;
    }
}
